from config import MAX_JUDGE_THREAD, TESTDATA_PATH
import sys

args = sys.argv

commands = {

}


def command(name, help, usage):
    def inner(func):
        commands[name] = (help, usage, func)
    return inner


def main(arg):
    if len(arg) == 0:
        print("请输入 judge help 查看帮助")
        return
    elif arg[0] in commands:
        try:
            commands[arg[0]][2](arg[1:])
        except Exception as ex:
            print(commands[arg[0]][1])
            raise ex
    else:
        print("请输入 judge help 查看帮助")
        return


from commands import *


if __name__ == "__main__":
    main(args[1:])
